import request from '@/config/axios'

// 预约服务 VO
export interface AppointmentGoodsVO {
  id: number // 服务记录唯一标识
  serviceName: string // 服务名称，如 WiFi 上门讲解服务、电视上门讲解服务等
  serviceDescription: string // 服务描述，使用Lorem ipsum等占位文本内容
}

// 预约服务 API
export const AppointmentGoodsApi = {
  // 查询预约服务分页
  getAppointmentGoodsPage: async (params: any) => {
    return await request.get({ url: `/appointment/goods/page`, params })
  },

  // 查询预约服务详情
  getAppointmentGoodsById: async (id: number) => {
    return await request.get({ url: `/appointment/goods/getById?id=` + id })
  },

  // 新增预约服务
  createAppointmentGoods: async (data: AppointmentGoodsVO) => {
    return await request.post({ url: `/appointment/goods/create`, data })
  },

  // 修改预约服务
  updateAppointmentGoods: async (data: AppointmentGoodsVO) => {
    return await request.post({ url: `/appointment/goods/update`, data })
  },

  // 修改预约服务状态
  updateAppointmentGoodsStatus: async (id: number, status: number) => {
    const data = {
      id,
      status
    }
    return await request.post({ url: `/appointment/goods/updateStatus`, data: data })
  },

  // 删除预约服务
  deleteAppointmentGoodsById: async (id: number) => {
    return await request.get({ url: `/appointment/goods/delete?id=` + id })
  },

  // 导出预约服务 Excel
  exportAppointmentGoods: async (params) => {
    return await request.download({ url: `/appointment/goods/export-excel`, params })
  }
}